﻿<local:PageBase x:Class="MicroBlogClient.Pages.UserPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:MicroBlogClient"
        xmlns:controls="clr-namespace:Rabbit.Controls;assembly=Rabbit.Controls"
      mc:Ignorable="d" 
      d:DesignHeight="300" d:DesignWidth="300"
	Title="UserPage">
    <local:PageBase.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary  Source="/Resources/StatusTemplate.xaml"/>
                <ResourceDictionary  Source="/Resources/UserTemplate.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </local:PageBase.Resources>
    <Border Style="{DynamicResource MainContentBackground}" Margin="0,0,0,0">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions> 
            <TabControl x:Name="tcMain" BorderThickness="0" Grid.Row="1" >
                <TabItem   Style="{DynamicResource SubHeaderMenuItemStyle}"
                         x:Name="tabItemStatus">
                     <TabItem.Header>
                         
                        <TextBlock 
                                   ToolTip="{Binding CurrentUser.Description}">
                            <Run Text="{Binding CurrentUser.ScreenName, FallbackValue=韩现龙}"/>
                            <Run Text="{Binding CurrentUser.StatusesCount,StringFormat=(微博{0})}"/>
                         </TextBlock>
                    </TabItem.Header>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <ListBox Grid.Row="0" x:Name="lstStatus" 
                                  ItemsSource="{Binding StatusCollection}"
                                 ItemTemplate="{StaticResource ResourceKey=StatusItemTemplate}" />
                        <local:UCPager x:Name="statusPager"  Grid.Row="1" OnFirstPageClick="pager_OnFirstPageClick"
                           OnPreviousePage="pager_OnPreviousePage" Tag="status"
                           OnNextPageClick="pager_OnNextPageClick"/>
                    </Grid>
                </TabItem>
                <TabItem  x:Name="tabItemFollowers"
                         Style="{DynamicResource SubHeaderMenuItemStyle}" >
                    <TabItem.Header>
                        <TextBlock Text="{Binding CurrentUser.FollowersCount,StringFormat=粉丝\{0\},FallbackValue=粉丝5000}"/>
                    </TabItem.Header>
                     <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <ListBox  x:Name="lstFollower" Grid.Row="0" 
                                  ItemsSource="{Binding FollowerCollection}"
                                  ItemTemplate="{StaticResource ResourceKey=UserItemsTemplate}" 
                                   />
                         <local:UCPager x:Name="followerPager"  Grid.Row="1" OnFirstPageClick="pager_OnFirstPageClick"
                           OnPreviousePage="pager_OnPreviousePage" Tag="follower"
                           OnNextPageClick="pager_OnNextPageClick"/>
                    </Grid>
                </TabItem>
                <TabItem  x:Name="tabItemFollowing" 
                         Style="{DynamicResource SubHeaderMenuItemStyle}" >
                     <TabItem.Header>
                        <TextBlock Text="{Binding CurrentUser.FriendsCount,StringFormat=关注\{0\},FallbackValue=粉丝5000}"/>
                    </TabItem.Header>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <ListBox  x:Name="lstFollowing"  Grid.Row="0" 
                                  ItemsSource="{Binding FollowingCollection}" 
                                   ItemTemplate="{StaticResource ResourceKey=UserItemsTemplate}" 
                                     />
                         <local:UCPager x:Name="followingPager"  Grid.Row="1" OnFirstPageClick="pager_OnFirstPageClick"
                           OnPreviousePage="pager_OnPreviousePage" Tag="following"
                           OnNextPageClick="pager_OnNextPageClick"/>
                    </Grid>
                </TabItem>
            </TabControl>
        </Grid>
    </Border>
</local:PageBase>
